package com.jeesite.modules.ch.entity.param;

import lombok.Getter;

@Getter
public enum MyTaskStatus {
    //我的任务状态：0进行中 1待审核 2已通过  3未通过 4 纠纷 5结束
    JINXINGZHONG("0", "进行中"),
    DIASHENHE("1", "待审核"),
    YITONGGUO("2", "已通过 "),
    WEITONGGUO("3", "未通过"),
    JIUFEN("4", "纠纷"),
    YIJIESHU("5", "结束"),
    CHAOSHIWEITIJIAO("99", "超时未提交"),
    ;

    private MyTaskStatus(String code, String message) {
        this.code = code;
        this.message = message;
    }

    private final String code;

    private final String message;

    //遍历枚举V1
    public static MyTaskStatus getTaskStatusEnum(String code) {
        for (MyTaskStatus element : MyTaskStatus.values()) {
            if (element.getCode().equalsIgnoreCase(code)) {
                return element;
            }
        }
        return null;
    }

    //遍历枚举V2
    public static String getTaskStatusSecond(String code) {
        for (MyTaskStatus element : MyTaskStatus.values()) {
            if (element.getCode().equalsIgnoreCase(code)) {
                return element.getMessage();
            }
        }
        return null;
    }
}